xend: passthrough: fix physdev_map_pirq invocation
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 7 Sep 2009 07:38:39 +0000 (08:38 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 7 Sep 2009 07:38:39 +0000 (08:38 +0100)
For those devices not having INTx (like VFs), avoid calling map_pirq,
otherwise the guest cannot be started successfully.

Also avoid calling this hypercall for hvm guest, this is done in the
device model.

Signed-off-by: Qing He <qing.he@intel.com>
tools/python/xen/xend/server/pciif.py

index 018309c3de678762ec40aac7ecc27005396531a4..c0b13d32b4a2530b3b886d857e11eb377bae09bc 100644 (file)
@@ -345,12 +345,13 @@ class PciController(DevController):
                 if rc<0:
                     raise VmError(('pci: failed to remove msi-x iomem'))
 
-        rc = xc.physdev_map_pirq(domid = fe_domid,
-                               index = dev.irq,
-                               pirq  = dev.irq)
-        if rc < 0:
-            raise VmError(('pci: failed to map irq on device '+
-                        '%s - errno=%d')%(dev.name,rc))
+        if not self.vm.info.is_hvm() and dev.irq:
+            rc = xc.physdev_map_pirq(domid = fe_domid,
+                                   index = dev.irq,
+                                   pirq  = dev.irq)
+            if rc < 0:
+                raise VmError(('pci: failed to map irq on device '+
+                            '%s - errno=%d')%(dev.name,rc))
         if dev.irq>0:
             log.debug('pci: enabling irq %d'%dev.irq)
             rc = xc.domain_irq_permission(domid =  fe_domid, pirq = dev.irq,